package util;

import java.sql.*;

public class ConnectionManager {
    
    public ConnectionManager() {
    }
    
    public static Connection connect()
    throws SQLException {
        try {
            if(isInited) {
                return DriverManager.getConnection("jdbc:odbc:2handeasy", "", "");
            } else {
                isInited = true;
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                return DriverManager.getConnection("jdbc:odbc:2handeasy", "", "");
            }
        } catch (Exception e) {
            throw new SQLException(e.getMessage());
        }
    }
    
    private static boolean isInited = false;
    
}
